Question 1

What type of notes would you expect to record a patient's history of hypertension?


Question 2

Which of the following note sections would you expect to contain information about a patient's history of hypertension?


Question 3

If you are trying to identify if a patient has hypertension or a history of hypertension, which note sections would you avoid searching?


Question 4

Is there a standard delimiter between sections in the discharge summary corpus? If so, what is the delimiter?


Question 5

After you split the discharge summary corpus using the standard delimiter - how many rows does your new data frame have?


Question 6

What delimiters can you use to separate the section header from the text in each section?


Question 7

Does the section header delimiter you identified work for every section?


Question 8

This question is ungraded. If you did not think that the section header delimiter worked in every section (i.e., you answered "No" to Question 7), what happened in the sections that did not work?


Question 9

How many unique section headers are there that describe the clinical history about the patient?


Question 10

Write one or more regular expressions (as needed) to capture the section headers that describe some form of clinical history (i.e., that have the word "history" in their name) about the patient.

To make this easier you can use the following code to get a copy of all relevant headers:

library(tidyverse)
library(magrittr)

headers <- tibble(SECTION_HEADER = c("HISTORY OF PRESENT ILLNESS", "HISTORY AND PHYSICAL", "BRIEF HISTORY", "CURRENT HISTORY", "PAST MEDICAL HISTORY", "BRIEF HISTORY AND PHYSICAL", "PAST SURGICAL HISTORY"))

Question 11

Using the regular expression you created in Question 10, try extracting the text after the matching section headers. Do all notes have one of those section headers?


Question 12

This question is ungraded. If your answer to Question 11 was "No" - were there any other sections in the notes that did not have a match that had the same clinical information, but that did not use the word "History"? If so, what regular expression can you use to extract those sections as well?


Question 13

How many unique types of section headers exist immediately after the clinical history section?


Question 14

Use the section headers you identified in Question 13, extract just the sections of interest for further analysis. How many of these patients had a diagnosis of hypertension listed in one of the clinical history sections?